<?php

class m120407_015451_create_registration extends CDbMigration {

	protected $_tables = array(
		'registration'=>array(
			'_id'=>'pk',
			'insertTime'=>'integer',
			'updateTime'=>'integer',
			'name'=>'string',
			'birthPlace'=>'string',
			'birthDate'=>'integer',
			'homeAddress'=>'text',
			'homeCityType'=>'string',
			'homeCity'=>'string',
			'province'=>'string',
			'secretariatAddress'=>'text',
			'secretariatCityType'=>'string',
			'secretariatCity'=>'string',
			'emails'=>'string',
			'phones'=>'string',
			'position'=>'string',
			'extension'=>'varchar(4)'
		),
	);

	public function safeUp() {
		foreach ($this->_tables as $key=>$value) {
			$this->createTable($key, $value);
		}
	}

	public function safeDown() {
		foreach ($this->_tables as $key=>$value) {
			$this->dropTable($key);
		}
	}

}